{include file="header.tpl"}
<link href="{$smarty.const.CSS}css.css" type="text/css" rel="stylesheet" />
<link href="{$smarty.const.CSS}jquery-ui-1.7.3.custom.css" type="text/css" rel="stylesheet" />
<style>
	input { width:200px;}
	.selectable .ui-selecting { background: #FECA40; }
	.selectable .ui-selected { background: #F39814; color: white; }
	.selectable { list-style-type: none; margin: 0; padding: 0; list-style:inline;}
	.selectable li { margin: 3px; padding: 0.4em;  height: 16px;float: left;}
	.secondary { display:none; }
	.important { color:red;}
	.dopic{ float:left; margin-left:10px;}
	</style>
<script type="text/javascript" src="{$smarty.const.JS}jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{$smarty.const.JS}jquery-ui-1.7.3.custom.min.js"></script>
</head>
<BODY>

<div id="loading">loading...<div></div></div>
<div id="allmain">
<form action="submit.php" method="post">
<input type="hidden" name="picname" value="{$picfile}"/>
<div class="kuang " >
<span>产品图片处理</span><br/>

<div class="dopic"><img src="{$smarty.const.PICURL}{$pic}" width="300px"/>

</div>

<div class="dopic">
<table width="570px">
<tr><td width="68px">产品编号:</td><td><input type="text" name="serial_number"/></td></tr>
<tr><td>上市时间:</td><td><input type="text" name="market_time"  id="datepicker"/></td></tr>
<tr><td>限量数:</td><td><input type="text" name="limit"/></td></tr>
<tr><td>产品说明:</td><td><input type="text" name="direction"/></td></tr>
<script>
	$(function() {
		$( "#datepicker" ).datepicker();
		$( "#datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" );

	});
	</script>
<tr><td class="important">产品类别*</td><td><input type="hidden" name="category" id="category-value" value=""/>
<ol id="category-selectable" class="selectable">
{foreach $type_category as $value}
	
	<li class="ui-widget-content" valueid="{$value@key}">{$value}</li>
	
{/foreach}
</ol></td></tr>
<tr><td>品牌首字母:</td>
<td>
<ol id="brand-letter-selectable" class="selectable">
<li class="ui-widget-content" valueid="a">A</li><li class="ui-widget-content" valueid="b">B</li>
<li class="ui-widget-content" valueid="c">C</li><li class="ui-widget-content" valueid="d">D</li>
<li class="ui-widget-content" valueid="e">E</li><li class="ui-widget-content" valueid="f">F</li>
<li class="ui-widget-content" valueid="g">G</li><li class="ui-widget-content" valueid="h">H</li>
<li class="ui-widget-content" valueid="i">I</li><li class="ui-widget-content" valueid="j">J</li>
<li class="ui-widget-content" valueid="k">K</li><li class="ui-widget-content" valueid="l">L</li>
<li class="ui-widget-content" valueid="m">M</li><li class="ui-widget-content" valueid="n">N</li>
<li class="ui-widget-content" valueid="o">O</li><li class="ui-widget-content" valueid="p">P</li>
<li class="ui-widget-content" valueid="q">Q</li><li class="ui-widget-content" valueid="r">R</li>
<li class="ui-widget-content" valueid="s">S</li><li class="ui-widget-content" valueid="t">T</li>
<li class="ui-widget-content" valueid="u">U</li><li class="ui-widget-content" valueid="v">V</li>
<li class="ui-widget-content" valueid="w">W</li><li class="ui-widget-content" valueid="x">X</li>
<li class="ui-widget-content" valueid="y">Y</li><li class="ui-widget-content" valueid="z">Z</li>
<li class="ui-widget-content" valueid="ot">other</li>
</ol>
</td></tr>
<tr><td>品牌:</td><td><input type="hidden" name="brand" id="brand-value" value=""/>
<ol id="brand-selectable" class="selectable">

</ol></td></tr>
</table>
<script>
$(function() {
		$( "#brand-letter-selectable" ).selectable({
			stop: function() {
				$( ".ui-selected", this ).each(function() {
					var index = $( "#brand-letter-selectable li" ).index(this);
					var valueid=$( "#brand-letter-selectable li:eq("+index+")" ).attr("valueid");
					$( "#brand-selectable" ).empty();	
					$.get("{$smarty.const.ROOTURL}lib/get_brand.php", { letter: valueid },
					function(html){
						$( "#brand-selectable" ).append(html);				
				});
			});
			}
		});
	});
	$(function() {
		$( "#brand-selectable" ).selectable({
			stop: function() {
				$( ".ui-selected", this ).each(function() {
					var index = $( "#brand-selectable li" ).index(this);
					var valueid=$( "#brand-selectable li:eq("+index+")" ).attr("valueid");
					$( "#brand-value" ).attr("value",valueid);
				});
			}
		});
	});

	$(function() {
		$( "#category-selectable" ).selectable({
			stop: function() {
				$( ".ui-selected", this ).each(function() {
					var index = $( "#category-selectable li" ).index(this);
					var valueid=$( "#category-selectable li:eq("+index+")" ).attr("valueid");
					$( "#category-value" ).attr("value",valueid);
					$( ".secondary" ).fadeOut(100);
					$( "#secondary-"+valueid ).fadeIn(100);
				});
				
			}
		});
	});
	</script>
</div>

<div class="clear"></div>
<div >
	
	{foreach $type_product as $item}
	<div id="{$item@key}" class="tab_div">	
	<table>
		<tr><td>{$item}&nbsp;选择:</td><td>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			{/if}
		{/foreach}
		</ol></td></tr>
		</table>
		<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	
	

	</div>
	<div class="clear"></div>
	{/foreach}
</div>


</div>


<div class="clear"></div>



{literal}
<script type="text/javascript">
$("#loading div").animate({width:"36px"},300);
</script>
{/literal}


<div class="tabs secondary" id="secondary-clothing">
	<ul>
	{foreach $type_clothing as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_clothing as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}
	
</div>

<div class="secondary tabs" id="secondary-watch">
<ul>
	{foreach $type_watch as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_watch as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}
	<table>
	<tr><td>表径：</td><td><input type="text" name="diameter"/></td></tr>
	<tr><td>表壳厚度：</td><td><input type="text" name="case_thickness"/></td></tr>
	<tr><td>表盘颜色：</td><td><input type="text" name="dial_color"/></td></tr>
	<tr><td>表盘材质：</td><td><input type="text" name="dial_material"/></td></tr>
	<tr><td>表带颜色：</td><td><input type="text" name="strap_color"/></td></tr>
	<tr><td>重量：</td><td><input type="text" name="weight"/></td></tr>
	<tr><td>机芯直径：</td><td><input type="text" name="movement_diameter"/></td></tr>
	<tr><td>机芯厚度：</td><td><input type="text" name="movement_thickness"/></td></tr>
	<tr><td>机芯零件数：</td><td><input type="text" name="parts"/></td></tr>
	<tr><td>其他功能：</td><td><input type="text" name="other_functions"/></td></tr>
	</table>
</div>

<div class="secondary tabs" id="secondary-shoe">
<ul>
	{foreach $type_shoe as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_shoe as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}
	<table>
	<tr><td>鞋跟高度:</td><td><input type="text" name="heel_height"/></td></tr>
	</table>
</div>

<div class="secondary tabs" id="secondary-jewelry">
<ul>
	{foreach $type_jewelry as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_jewelry as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}
	
</div>

<div class="secondary tabs" id="secondary-bag">
<ul>
	{foreach $type_bag as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_bag as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}
	<table>
	<tr><td>尺寸:</td><td><input type="text" name="dimension"/></td></tr>
	<tr><td>图案:</td><td><input type="text" name="bag_pattern"/></td></tr>
	</table>
</div>
<div class="secondary tabs" id="secondary-glass">
<ul>
	{foreach $type_glass as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_glass as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}

</div>
<div class="secondary tabs" id="secondary-accessory">
<ul>
	{foreach $type_accessory as $item}
		<li><a href="#{$item@key}">{$item}</a></li>
	{/foreach}
	</ul>
	{foreach $type_accessory as $item}
	<div id="{$item@key}" class="tab_div">
		<span class="feedback">
		<span>{$item}&nbsp;选择:</span> <span id="{$item@key}-select-result"></span>
		<input type="hidden" name="{$item@key}" id="{$item@key}-value" value="">
		</span>
		<ol id="{$item@key}-selectable" class="selectable">
		{foreach $alltype as $value}
			{if $value.belongto eq $item@key}
			
			<li class="ui-widget-content" valueid="{$value.id}">{$value.typename}</li>
			
			{/if}
		{/foreach}
		</ol>
	</div>
	<div class="clear"></div>
	<script>
	$(function() {
		$( "#{$item@key}-selectable" ).selectable({
			stop: function() {
				var result = $( "#{$item@key}-select-result" ).empty();
				
				$( ".ui-selected", this ).each(function() {
					var index = $( "#{$item@key}-selectable li" ).index(this);
					result.append(  $( "#{$item@key}-selectable li:eq("+index+")" ).text()  );
					var valueid=$( "#{$item@key}-selectable li:eq("+index+")" ).attr("valueid");
					$("#{$item@key}-value").attr("value",valueid);
				});
			}
		});
	});
	</script>
	{/foreach}
</div>

<table>
<tr><td><input type="submit" value=" 提  交 "/></td>
</form>
{if $cansame}
<td>
<form action="submit.php?s" method="post">
<input type="hidden" name="picname" value="{$picfile}"/>
<input type="submit" value="同上一张图"/>
</form>
</td>
{/if}
<td>&nbsp;<a href="../index_user.php">返回列表&nbsp;<a href="../outuser.php">登出</a></a></td></tr>
</table>
</div>
{literal}
<script>
	$(function() {
		$( ".tabs" ).tabs();
	});

$("#loading div").animate({width:"100px"},500,function(){
	$("#loading").fadeOut(500);
	$("#allmain").fadeIn(500);
	});
	
</script>
{/literal}
{include file="footer.tpl"}